<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Default/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="MvcContrib.UI.Html" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=Html.Resource("User", "TITLE_CHANGEPASSWORD")%>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2><%=Html.Resource("User", "TITLE_CHANGEPASSWORD")%></h2>
    <%if (ViewData["ErrorMessage"] != null)
      { %>
        <div class="tabcontainer">
        <%=Html.RenderjQueryErrorDiv((string)ViewData["ErrorMessage"],"width:630px;") %>
        </div>
    <%} %>
    <form id="form1" action="/User/ChangePassword" method="post">
        <% =Html.RenderForm(ViewData.Model) %>
        <div class="tabcontainer">
        <input type="submit" value="<% =Html.Resource("Global","CHANGE") %>" name="button" class="button" accesskey="S"/>
        </div>
    </form>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<%=Html.ScriptInclude("~/Scripts/jquery-validate/jquery.validate.min.js")%>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="PostScript" runat="server">
    <script type="text/javascript" language="javascript">
        $(document).ready(function() {
            $("#form1").validate({
                rules: {
                    oldpassword: {
                        required: true,
                    },
                    newPassword: {
                        required: true,
                        minlength: 6,
                        maxlength: 15
                    },
                    newPassword2: {
                        required: true,
                        minlength: 6,
                        maxlength: 15,
                        equalTo: "#newPassword"
                    }
                },
                messages:
                {
                    password2:
                    {
                        equalTo: "The two new passwords should be same"
                    }
                }
            });
        });
    </script>
</asp:Content>
